package cc.rengu.igas.route.common.enums;

/**
 * 是否需要签约枚举
 *
 * @author lizhangtao
 * @version 1.0
 * @date 20200708
 */
public enum MustSignEnum {

    /**
     * 不需要签约
     */
    NONEED("0", "不需要签约"),
    /**
     * 必需签约
     */
    MUST("1", "需要签约"),
    ;

    /**
     * 码值
     */
    private String code;
    /**
     * 描述
     */
    private String name;

    MustSignEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static MustSignEnum create(String code) {
        MustSignEnum type = null;
        if (null == code) {
            return null;
        }
        switch (code) {
            case "0":
                type = NONEED;
                break;
            case "1":
                type = MUST;
                break;
            default:
                break;
        }
        return type;
    }

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return name;
    }
}
